﻿using System;

namespace UniRx.Operators
{
	// Token: 0x020002B8 RID: 696
	internal class IgnoreElementsObservable<T> : OperatorObservableBase<T>
	{
		// Token: 0x06000F1D RID: 3869 RVA: 0x00046704 File Offset: 0x00044B04
		public IgnoreElementsObservable(IObservable<T> source) : base(source.IsRequiredSubscribeOnCurrentThread<T>())
		{
			this.source = source;
		}

		// Token: 0x06000F1E RID: 3870 RVA: 0x00046719 File Offset: 0x00044B19
		protected override IDisposable SubscribeCore(IObserver<T> observer, IDisposable cancel)
		{
			return this.source.Subscribe(new IgnoreElementsObservable<T>.IgnoreElements(observer, cancel));
		}

		// Token: 0x040008CE RID: 2254
		private readonly IObservable<T> source;

		// Token: 0x020002B9 RID: 697
		private class IgnoreElements : OperatorObserverBase<T, T>
		{
			// Token: 0x06000F1F RID: 3871 RVA: 0x0004672D File Offset: 0x00044B2D
			public IgnoreElements(IObserver<T> observer, IDisposable cancel) : base(observer, cancel)
			{
			}

			// Token: 0x06000F20 RID: 3872 RVA: 0x00046737 File Offset: 0x00044B37
			public override void OnNext(T value)
			{
			}

			// Token: 0x06000F21 RID: 3873 RVA: 0x0004673C File Offset: 0x00044B3C
			public override void OnError(Exception error)
			{
				try
				{
					this.observer.OnError(error);
				}
				finally
				{
					base.Dispose();
				}
			}

			// Token: 0x06000F22 RID: 3874 RVA: 0x00046774 File Offset: 0x00044B74
			public override void OnCompleted()
			{
				try
				{
					this.observer.OnCompleted();
				}
				finally
				{
					base.Dispose();
				}
			}
		}
	}
}
